package com.itheima.clients;

import com.itheima.clients.impl.UserFeignApiFallBack;
import com.itheima.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.context.annotation.Primary;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@FeignClient(value = "user-service", fallback = UserFeignApiFallBack.class)
@Primary
public interface UserFeignApi {

    @GetMapping("/user/{id}")
    User findById(@PathVariable("id") String username);

}
